From f6c2c2edbd3fc86fa5d6e6c31a10084de4d46df7 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 30 Jun 2020 23:31:02 +0200 Subject: [PATCH] stringlist: Call splice() for adding items after construction This has the benefit of actually allowing NULL to be passed. --- gtk/gtkstringlist.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gtk/gtkstringlist.c b/gtk/gtkstringlist.c index a3e2af5f68..608081d500 100644 --- a/gtk/gtkstringlist.c +++ b/gtk/gtkstringlist.c @@ -434,12 +434,10 @@ GtkStringList * gtk_string_list_new (const char * const *strings) { GtkStringList *self; - guint i; self = g_object_new (GTK_TYPE_STRING_LIST, NULL); - for (i = 0; strings[i]; i++) - g_sequence_append (self->items, gtk_string_object_new (strings[i])); + gtk_string_list_splice (self, 0, 0, strings); return self; } -- 2.30.2